home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Taifun / Taifun 080 (1988-11-15)(Ossowski, Stefan)(DE)(PD).zip / Taifun 080 (1988-11-15)(Ossowski, Stefan)(DE)(PD).adf / Go64 / Go64.c < prev    next >
C/C++ Source or Header  |  1988-08-14  |  5KB  |  168 lines

  1. /******************************************************************************
  2. **********                                 **********
  3. **********             THE REAL EMULATOR (?)                    **********
  4. **********                                 **********
  5. *******************************************************************************
  6. **********                                 **********
  7. ********** Yet another brain-crash by Magic Ceee (ouch, that hurts!) **********
  8. **********                                 **********
  9. ******************************************************************************/
  10.  
  11. #include "intuition/intuition.h"
  12. #include "graphics/gfxbase.h"
  13.  
  14. struct IntuitionBase        *IntuitionBase;
  15. struct GfxBase            *GfxBase;
  16. struct Screen            *MagicScreen;
  17. struct Window            *MagicWindow;
  18. struct RastPort            *MagicRast;
  19. struct ViewPort            *MagicView;
  20.  
  21. struct AlertMessage
  22.     {
  23.     WORD X;
  24.     BYTE Y;
  25.     char text[58];
  26.     BYTE count;
  27.     }
  28.  
  29. texttab[]=
  30.     {
  31.     80,17,"  Illegal copy of  *** MicroBeastie C-64 Emulator ***    ",99,
  32.     80,32,"     Press left mouse button to format your disks.       ",0
  33.     };
  34.  
  35. /****************************************************************************/
  36.  
  37. struct NewScreen ns = {
  38. 0,0,640,200,2,0,0,HIRES,CUSTOMSCREEN,NULL,NULL,NULL,NULL };
  39.  
  40. struct NewWindow nw = {
  41. 0,0,640,200,0,0,RAWKEY,SIMPLE_REFRESH|BORDERLESS|ACTIVATE,
  42. NULL,NULL,NULL,NULL,NULL,0,0,0,0,CUSTOMSCREEN };
  43.  
  44. UWORD Sprite_data[] = {        /* Invisible Pointer */
  45. 0,0,
  46. 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  47. 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  48. 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  49. 0,0 };
  50.  
  51. char *lies[] = { "Installing 6502 routines...\n",
  52.          "Installing Kernel..........\n",
  53.          "Checking Interpreter.......\n",
  54.          "\nTransforming!\n",
  55.          "\nAmiga C-64 Emulator V2.7, designed by Magic Ceee.\n\n" };
  56.  
  57. /*****************************************************************************/
  58.  
  59. main()
  60. {
  61.  int i;
  62.  
  63.  Write(Output(),lies[4],strlen(lies[4]));
  64.  
  65.  for(i=0;i<=3;Tell_A_Lie(lies[i++]));
  66.  
  67.  OpenStuff();
  68.  
  69.  /****************************************************************************
  70.  *** Kick pointer outa sight                           ***
  71.  ****************************************************************************/
  72.  
  73.  SetPointer(MagicWindow,&Sprite_data[0],15,15,-7,-7);
  74.  
  75.  /****************************************************************************
  76.  *** Steal a RastPort      ...and a ViewPort                   ***
  77.  ****************************************************************************/
  78.  
  79.  MagicRast=MagicWindow->RPort;
  80.  
  81.  MagicView=(struct ViewPort *)ViewPortAddress(MagicWindow);
  82.  
  83.  /****************************************************************************
  84.  *** Set display characteristics                       ***
  85.  ****************************************************************************/
  86.  
  87.  ShowTitle(MagicScreen,FALSE);        /* No screen title */
  88.  
  89.  SetRGB4(MagicView,0,0,0,8);        /* Dark blue */
  90.  SetRGB4(MagicView,2,8,8,15);        /* Light blue */
  91.  SetRGB4(MagicView,3,0,0,8);
  92.  
  93.  SetRast(MagicRast,2);            /* Fill screen using color reg. #2 */
  94.  SetAPen(MagicRast,3);            /* Use color reg. #3 */
  95.  RectFill(MagicRast,38,9,602,189);    /* Display a dark blue area */
  96.  
  97.  /****************************************************************************
  98.  *** Well...do you believe it's true?                       ***
  99.  ****************************************************************************/
  100.  
  101.  SetAPen(MagicRast,2);
  102.  Move(MagicRast,179,20);
  103.  Text(MagicRast,"**** COMMODORE 64 BASIC V2 ****",31);
  104.  Move(MagicRast,145,34);
  105.  Text(MagicRast,"64K RAM SYSTEM  38911 BASIC BYTES FREE",38);
  106.  Move(MagicRast,44,53);
  107.  Text(MagicRast,"READY",5);
  108.  
  109.  for(;;)
  110.     {
  111.      Delay(27);            /* Time left before cursor says hello again */
  112.      SetAPen(MagicRast,2);
  113.      RectFill(MagicRast,44,55,52,62);    /* Draw a cursor  */
  114.      Delay(27);                /* ...and wait... */
  115.      SetAPen(MagicRast,3);
  116.      RectFill(MagicRast,44,55,52,62);    /* ...then kick it outa sight */
  117.      if(GetMsg(MagicWindow->UserPort)) break;    /* Any user activities? */
  118.     }
  119.  
  120.  DisplayAlert(RECOVERY_ALERT,&texttab,45);    /* Yes, so let's panic */
  121.  GoHome("\f\n\n\n --> Magic Ceee says: ceeein' is beleeevin'...\n\n");
  122. }
  123.  
  124. /****************************************************************************/
  125.  
  126. Tell_A_Lie(which_lie)
  127. char *which_lie;
  128. {
  129.  Write(Output(),which_lie,strlen(which_lie));
  130.  Delay(4*50);
  131. }
  132.  
  133. /****************************************************************************/
  134.  
  135. OpenStuff()
  136. {
  137.  if(!(IntuitionBase=(struct IntuitionBase *)
  138.    OpenLibrary("intuition.library",0))) 
  139.      GoHome("Intuition won't open!\n");
  140.  
  141.  if(!(GfxBase=(struct GfxBase *)
  142.    OpenLibrary("graphics.library",0)))
  143.      GoHome("Graphix won't open!\n");
  144.  
  145.  if(!(MagicScreen=OpenScreen(&ns)))
  146.    GoHome("Can't open that damned screen!\n");
  147.  
  148.  nw.Screen=MagicScreen;
  149.  if(!(MagicWindow=OpenWindow(&nw)))
  150.    GoHome("It's cold outside - Intuition won't open a window!\n");
  151.  
  152.  
  153. }
  154.  
  155. /****************************************************************************/
  156.  
  157. GoHome(msg)
  158. char *msg;
  159. {
  160.  Write(Output(),msg,strlen(msg));
  161.  
  162.              ClearPointer(MagicWindow);
  163.  if(MagicWindow)    CloseWindow(MagicWindow);
  164.  if(MagicScreen)    CloseScreen(MagicScreen);
  165.  if(GfxBase)        CloseLibrary(GfxBase);
  166.  if(IntuitionBase)    CloseLibrary(IntuitionBase);
  167. }
  168.